<template>
  <div>
  <SideMenu></SideMenu>
      <div>
      <el-row style="margin-top: 20px;margin-left: 300px">
        <el-col :span="8" v-for="(o, index) in lessons" :key="o" :offset="index > 0 ? 2 : 0">
          <el-card :body-style="{ padding: '0px' }">
            <div style="padding: 14px;">
              <p >课程：{{o.lessonname }} </p>
              <p >课程详情：{{ o.info }}</p>
              <p >课程成绩:  {{o.scope }}</p>
              <p >学习进度： </p>
              <el-progress :text-inside="true" :stroke-width="24" :percentage="jindu" status="success"></el-progress>
              <br>
              <el-button type="success">开始学习</el-button>
            </div>
          </el-card>
        </el-col>
      </el-row>
      </div>
  </div>
</template>

<script>
    import SideMenu from "./SideMenu";
    export default {
        name: "CaseStudy",
      components: {SideMenu},
      data() {
        return {
          circleUrl: "https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png",
          sizeList: ["large", "medium", "small"],

          homeworkname:"",
          homeworkinfo:'',
          scope:"",
          jindu:"50",
          lessons:[],

          showname:JSON.parse(window.sessionStorage.getItem('iflogin')), //判断登录
          loginname:window.sessionStorage.getItem('username'),
        }

      },
      created () {
        this.getLesson()
      },
      methods:{
        getLesson() {
          this.$axios
            .post('/studentlessons', {
              username:window.sessionStorage.getItem('username')
            })
            .then(successResponse => {
              console.log(successResponse.data)
              this.lessons = successResponse.data

            })
            .catch(failResponse => {
            })
        },
      }
    }
</script>

<style scoped>
  .el-header, .el-footer {
    background-color: #fafafa;
    color: #090909;
    text-align: center;
    line-height: 60px;
  }

  .el-aside {
    background-color: #ffffff;
    color: #020202;
    text-align: center;
    line-height: 200px;
  }

  .el-main {
    background-color: #ffffff;
    color: #0a0a0a;
    text-align: center;
    line-height: 160px;
  }

  body > .el-container {
    margin-bottom: 40px;
  }

  .el-container:nth-child(5) .el-aside,
  .el-container:nth-child(6) .el-aside {
    line-height: 260px;
  }

  .el-container:nth-child(7) .el-aside {
    line-height: 320px;
  }
  .time {
    font-size: 13px;
    color: #999;
  }

  .bottom {
    margin-top: 13px;
    line-height: 12px;
  }

  .button {
    padding: 0;
    float: right;
  }

  .image {
    width: 100%;
    display: block;
  }

  .clearfix:before,
  .clearfix:after {
    display: table;
    content: "";
  }

  .clearfix:after {
    clear: both
  }
</style>
